const {
	defineConfig
} = require('@vue/cli-service')

const TerserPlugin = require('terser-webpack-plugin')

module.exports = defineConfig({
	publicPath: './',
	lintOnSave: false,
	productionSourceMap: false, //去掉打包的时候生成的map文件
	configureWebpack: {
		optimization: {
			minimizer: [
				new TerserPlugin({
					terserOptions: {
						compress: {
							drop_console: true // 注释console
						}
					}
				})
			]
		}
	},
	transpileDependencies: true,
	outputDir: 'rf',
	devServer: {
		port: 8099,
		open: true, //自动弹出浏览器
		proxy: {
			[process.env.VUE_APP_BASE_URL]: {
				target: 'http://127.0.0.1:8085',
				changeOrigin: true,
				ws: true,
				pathRewrite: {
					['^' + process.env.VUE_APP_BASE_URL]: ''
				}
			}
		}
	}

})